\lstset{language=caml, keywordstyle=\color{violet}\bfseries, commentstyle=\color{red}\textit,stringstyle=\color{black}\ttfamily}
\begin{lstlisting}[breaklines=true, breakatwhitespace=true]
(*********************************************************)
(*                                                       *)
(*                   Objective Caml                      *)
(*                                                       *)
(*             Mathias Bourgoin & Adrien Jonquet         *)
(*                                                       *)
(*     Module GERO : Interfacage CELL-Objective Caml     *)
(*                                                       *)
(*********************************************************)

(* Types *)
type context 
type pthread_t
type spe_program_handle_t

(* THREADS functions *)
external pthread_create: context -> pthread_t = "gero_pthread_create"
external join: pthread_t -> unit = "gero_join"

(* CONTEXT functions *)
external spe_context_destroy: context -> unit = "gero_spe_context_destroy"
external spe_count_physical_spes: unit -> int = "gero_spe_count_physical_spes"
external spe_count_usable_spes: unit -> int = "gero_spe_count_usable_spes"
external spe_context_create: unit -> context = "gero_spe_context_create"
(* la fct load reste en C *)
external spe_context_run: context -> unit =  "gero_spe_context_run" 

external spe_image_open: string -> spe_program_handle_t = "gero_spe_image_open"
(* DMA functions *)

(* Gestion de Types *) 
let floats32 = Bigarray.float32 
let ints8 = Bigarray.int8_signed
let intu8 = Bigarray.int8_unsigned
let ints16 = Bigarray.int16_signed
let intu16 = Bigarray.int16_unsigned
let ints32 = Bigarray.int32
let int64 = Bigarray.int64
let float64 = Bigarray.float64

(* types available on PPU and SPU *)
type ('a, 'b) p = ('a, 'b) Bigarray.kind
type ('a, 'b) v = ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t
type ('a, 'b) m = ('a, 'b, Bigarray.c_layout) Bigarray.Array2.t

(* CAML functions *)
let create content dim = Bigarray.Array1.create content Bigarray.c_layout dim
let dim v =  Bigarray.Array1.dim v
let get a x =  Bigarray.Array1.get a x
let set a x v =  Bigarray.Array1.set a x v
let of_array k a =  Bigarray.Array1.of_array k Bigarray.c_layout a
let map_file f k b n =  Bigarray.Array1.map_file f k Bigarray.c_layout b n

(* SIMD functions *)
(* fmaf4 PPU sur des vecteurs de taille n *)
external fmaf4: ('a, 'b) v -> ('a, 'b) v -> ('a, 'b) v -> ('a, 'b) v = "gero_fmaf4"
(* fmaf4 SPUs sur des vecteurs de taille n *)
external fmaf4_spu: ('a, 'b) v -> ('a, 'b) v -> ('a, 'b) v -> ('a, 'b) v = "gero_fmaf4_spu"
external load_fmaf4_spu: context-> unit = "gero_load_fmaf4_spu"
external load_hello1_spu: context -> unit = "gero_load_hello1_spu"

\end{lstlisting}
